<template>
  <div class="header">
    <div class="header-left" @click="$emit('go-back')">
      <i class="el-icon-arrow-left"></i>
      <span>返回</span>
    </div>
    <div class="header-title">{{ title }}</div>
    <div class="header-right" @click="$emit('toggle-menu')">
      <span>切换菜单</span>
<!--      <i class="el-icon-menu"></i>-->
    </div>
  </div>
</template>

<script>
export default {
  name: 'AppHeader',
  
  props: {
    title: {
      type: String,
      default: '应急值守'
    }
  }
};
</script>

<style scoped>
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: var(--theme-bg);
  color: var(--theme-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  z-index: 1000;
  box-shadow: 0 2px 8px var(--theme-shadow);
  transition: background var(--animation-duration), box-shadow var(--animation-duration);
}

.header-left {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: opacity var(--animation-duration);
  color: var(--theme-primary);
}

.header-left:active {
  opacity: 0.7;
}

.header-left i {
  font-size: 20px;
  margin-right: 8px;
}

.header-title {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  text-align: center;
  padding: 0 10px;
  color: var(--theme-text);
  transition: color var(--animation-duration);
}

.header-right {
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  transition: opacity var(--animation-duration);
  color: var(--theme-primary);
}

.header-right:active {
  opacity: 0.7;
}

.header-right i {
  margin-left: 4px;
  font-size: 18px;
}
</style>

